<template>
  <div class='comment-page'>
    <comment-item v-for='(item,index) in dataList' :key='index' :Data='item'></comment-item>
  </div>
</template>

<script>
import {mapState} from 'vuex'
import commentItem from '@/components/commentItem'
export default {
  name: 'Comment',
  data () {
    return {
      dataList: []
    }
  },
  computed: {
    ...mapState([
      'openId'
    ])
  },
  components: {
    commentItem
  },
  methods: {
    getData () { // 获取用户提交的需求列表
      this.$http.get(`/wapp/desired/${this.openId.openid}/1/20`).then(res => {
        if (res) {
          this.dataList = res
        }
      }).catch(err => {
        console.dir(err)
      })
    }
  },
  mounted () {
    this.getData()
  }
}
</script>

<style scoped lang='less'>
  .comment-page{
    background:#F0F0F0;
  }
</style>
